import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/airport/facility/facilityPage',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/airport/facility/addFacility',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/airport/facility/getFacilityById/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/airport/facility/removeFacility/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/airport/facility/updateFacility',
    method: 'put',
    data: obj
  })
}
// 批量修改
export function putObjSelect(obj) {
  return request({
    url: '/airport/facility/updateFacilitySelect',
    method: 'put',
    data: obj
  })
}
// 根据id获取以前版本
export function getListVersion(id) {
  return request({
    url: '/airport/facility/facilityVersion/' + id,
    method: 'get'
  })
}

// 获取航站楼
export function getRegionByPid(pid) {
  return request({
    url: '/airport/region/getRegionByPid/' + pid,
    method: 'get'
  })
}

// 获取区域
export function getRegionByCode(code) {
  return request({
    url: '/airport/region/getRegionByCode/' + code,
    method: 'get'
  })
}

// 获取类别
export function allCategory() {
  return request({
    url: '/airport/category/allCategory',
    method: 'get'
  })
}

// 获取材质
export function allMaterial() {
  return request({
    url: '/airport/material/allMaterial',
    method: 'get'
  })
}

// 获取获取厂商
export function allVendor() {
  return request({
    url: '/airport/vendor/allVendor',
    method: 'get'
  })
}

// 获取规格
export function allSpecification() {
  return request({
    url: '/airport/specification/allSpecification',
    method: 'get'
  })
}

export function importExc(obj) {
  return request({
    url: '/airport/facility/importExcel',
    method: 'post',
    data: obj
  })
}

export function importPicture(obj) {
  return request({
    url: '/airport/public/pictureUpload',
    method: 'post',
    data: obj
  })
}

